const { fnm, fnm_s } = require('../test-utils');
/**
 *
 * @param {import('webpack').Compilation} compilation
 */
module.exports = function (compilation) {
  const name = '个人测试 TestCompilationPlugin-OptimizeToChunks';

  compilation.hooks.optimizeDependencies.tap(name, (modules) => {
    console.log('------------- optimizeDependencies');
  });
  compilation.hooks.afterOptimizeDependencies.tap(name, (modules) => {
    console.log('------------- afterOptimizeDependencies');
  });
  compilation.hooks.optimize.tap(name, () => {
    console.log('------------- optimize');
  });
  compilation.hooks.optimizeModules.tap(name, (modules) => {
    console.log('------------- optimizeModules');
  });
  compilation.hooks.afterOptimizeModules.tap(name, (modules) => {
    console.log('------------- afterOptimizeModules');
  });
  compilation.hooks.optimizeChunks.tap(name, (chunks) => {
    console.log('------------- optimizeChunks');
  });
  compilation.hooks.afterOptimizeChunks.tap(name, (chunks) => {
    console.log('------------- afterOptimizeChunks');
  });
  compilation.hooks.optimizeTree.tapAsync(name, (chunks, modules, callback) => {
    console.log('------------- optimizeTree');
    callback();
  });
  compilation.hooks.afterOptimizeTree.tap(name, (chunks, modules) => {
    console.log('------------- afterOptimizeTree');
  });
  compilation.hooks.optimizeChunkModules.tap(name, (chunks, modules) => {
    console.log('------------- optimizeChunkModules');
  });
  compilation.hooks.afterOptimizeChunkModules.tap(name, (chunks, modules) => {
    console.log('------------- afterOptimizeChunkModules');
  });
};
